<%@page contentType="text/html; charset=UTF-8" language="java" %>
<html>
	<head>
		<meta charset="utf-8">
		<!--声明文档兼容模式，表示使用IE浏览器的最新模式-->
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<!--设置视口的宽度(值为设备的理想宽度)，页面初始缩放值<理想宽度/可见宽度>-->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
		<title>图书在线首页</title>

		<!-- 引入Bootstrap核心样式文件 -->
		<link href="${pageContext.request.contextPath}/static/front/css/bootstrap.css" rel="stylesheet">

		<!-- 引入jQuery核心js文件 -->
		<script src="${pageContext.request.contextPath}/static/front/js/jquery-1.11.3.min.js"></script>
		<!-- 引入BootStrap核心js文件 -->
		<script src="${pageContext.request.contextPath}/static/front/js/bootstrap.min.js"></script>
		<script src="${pageContext.request.contextPath}/static/back/lib/layui/layui.js" charset="utf-8"></script>
		<link href="${pageContext.request.contextPath}/static/back/lib/layui/css/layui.css" rel="stylesheet">

		<style>
			body {
				margin-top: 20px;
				margin: 0 auto;
			}
			
			.carousel-inner .item img {
				width: 100%;
				height: 300px;
			}
			
			.container .row div {
				/* position:relative;
	 float:left; */
			}
			
			font {
				color: #666;
				font-size: 22px;
				font-weight: normal;
				padding-right: 17px;
			}
		</style>
	</head>

	<body>

		<!--logo部分-->
		<div class="container">
			<div class="col-lg-4 col-md-4 col-sm-6">
				</div>
				<div class="col-lg-5 col-md-5 hidden-xs col-sm-6">
					
				</div>
			<div class="col-md-3 text-right" style="padding-top:30px">
				<ol class="list-inline">
					<li>
<<<<<<< HEAD
						<a href="./regist.html">没有帐号? 注册</a>
=======
						<a href="${pageContext.request.contextPath}/front/registeview">没有账号?立即注册</a>
					</li>
					<li>
						<a href="${pageContext.request.contextPath}/back/login" style="color: red">管理员登录</a>
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
					</li>
				</ol>
			</div>
		</div>
		
		<!--主体部分-->
		<div class="container" style="height:650px;background:url('${pageContext.request.contextPath}/static/front/img/login_bg.jpg') no-repeat;">
			<div class="row">
				<div class="col-md-8">
					<!--<img src="./image/login.jpg" width="500" height="330" alt="会员登录" title="会员登录">-->
				</div>

				<div class="col-md-4">
					<div style="width:100%;border:1px solid #E7E7E7;padding:20px 0 20px 30px;border-radius:5px;margin-top:60px;background:#fff;">
						<font>会员登录</font>USER LOGIN

						<hr/>
						<form class="form-horizontal">

							<div class="form-group">
								<div class="col-sm-11 input-group">
									<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
									<input type="text" class="form-control"  name="username" id="username" placeholder="请输入用户名">
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-11 input-group">
									<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
									<input type="password" class="form-control" name="password" id="password" placeholder="请输入密码">
								</div>
							</div>
							
							<div class="form-group ">
								<div class="col-sm-10">
									<div class="checkbox">
										&nbsp;<label>
											<input type="checkbox"> 自动登录
        								</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										<label>
									        <input type="checkbox"> 记住用户名
									    </label>
									</div>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-11">
									<input type="button" id="login_btn" class="btn btn-block btn-danger" lay-submit lay-filter="login" width="100" value="登录" name="submit">
								</div>
							</div>
<<<<<<< HEAD
=======
							<input type="hidden" name="activeMsg" id="activeMsg" value="${sessionScope.msg}" />
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
						</form>
					</div>
				</div>
			</div>
		</div>

<<<<<<< HEAD
=======

>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
		<hr />

		<!--友情链接和版权信息-->
		<div class="container" style="margin-top: 10px;">
			<div class="row">
				<div class="" align="center">
					<ul class="list-inline">
						<li><a>关于我们</a></li>
						<li><a>联系我们</a></li>
						<li><a>招贤纳士</a></li>
						<li><a>法律声明</a></li>
						<li><a>友情链接</a></li>
						<li><a>支付方式</a></li>
						<li><a>配送方式</a></li>
						<li><a>服务声明</a></li>
						<li><a>广告声明</a></li>
					</ul>
				</div>
				<div style="text-align: center;margin-top: 5px;margin-bottom:20px;">
					Copyright &copy; 2003-2017 书城 版权所有
				</div>
			</div>
		</div>
	</body>
<script>
<<<<<<< HEAD
	var layer;
	layui.use('layer',function () {
		layer = layui.layer;
	})
=======
	$(function(){
		var layer;
		layui.use('layer',function () {
			layer = layui.layer;
		})

	});
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8

	$('#login_btn').click(function () {
		var username = $('#username').val();
		var password = $('#password').val();
		var data = {'username':username,'password':password}
		$.ajax({
			url:'${pageContext.request.contextPath}/front/login',
			type:'POST',
			data:data,
			dataType:'JSON',
			success:function (res) {
				layer.msg(res.message)
				if (res.code === 100){
					location.href = '${pageContext.request.contextPath}/front/index'
				}
			}
		})
	})

<<<<<<< HEAD
=======
	<%--layer.alert(${sessionScope.msg})--%>
	let msg = $('#activeMsg').val();
	if (msg.length !=0 ){
		alert(msg);
	}

>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
</script>
</html>